<template>
    <div style="padding:10px 20px">
      <div v-if="param==1">
        <el-tabs v-model="activeName" >
            <el-tab-pane label="自动起草通知书" name="1" v-if="menuIds.includes(7)">
              <projectPreparation v-if="activeName==1"/>
            </el-tab-pane>
        </el-tabs>
      </div>
      <div v-if="param==2">
        <el-tabs v-model="activeName2" >
            <el-tab-pane label="审计模型" name="1" v-if="menuIds.includes(8)">
              <sql-create  v-if="activeName2==1"/>
            </el-tab-pane>
            <el-tab-pane label="会议纪要查询" name="2" v-if="menuIds.includes(9)">
              <meeting-minutes  v-if="activeName2==2"/>
            </el-tab-pane>
            <el-tab-pane label="重大决策部署落实" name="3" v-if="menuIds.includes(10)">
              <importent-plan v-if="activeName2==3"/>
            </el-tab-pane>
            <el-tab-pane label="法规检索" name="4" v-if="menuIds.includes(11)">
              <regulatory-search v-if="activeName2==4"/>
            </el-tab-pane>
            <el-tab-pane label="自动生成取证单" name="5" v-if="menuIds.includes(12)">
              <pickup-form  v-if="activeName2==5"/>
            </el-tab-pane>
            <el-tab-pane label="自动生成审计底稿" name="6" v-if="menuIds.includes(13)">
              <auto-workpaper v-if="activeName2==6"/>
            </el-tab-pane>
            <el-tab-pane label="标书查雷同性检查" name="7" v-if="menuIds.includes(14)">
              <similarity-check  v-if="activeName2==7"/> 
            </el-tab-pane>
            <el-tab-pane label="自动生成取证单(新)" name="8" v-if="menuIds.includes(12)">
              <pickup-form-new  v-if="activeName2==8"/>
            </el-tab-pane>
            
          </el-tabs>
      </div>
      <div v-if="param==3">
        <el-tabs v-model="activeName3" >
            <el-tab-pane label="审计问题定性" name="1" v-if="menuIds.includes(15)">
               <!-- <div style="position: relative; width: 100%; height: 100%; min-height: 500px; overflow: hidden;">
                <iframe
                  src="http://100.75.55.185:8080/chatbot/PQlbtEeUsQEIIBoA"
                  style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; overflow: hidden;"
                  frameborder="0"
                  allow="microphone">
                </iframe>
              </div> -->
              <problem-analysis  v-if="activeName3==1"/>
            </el-tab-pane>
            <el-tab-pane label="审计报告生成" name="2" v-if="menuIds.includes(16)">
              <div style="flex:1;border-left:1px solid #f2f3f5;padding:20px;display:flex;justify-content: center;
        align-items: center;" v-if="activeName3==2">
                   <el-empty description="正在开发中，请稍后"></el-empty>
                </div>
            </el-tab-pane>
          </el-tabs>
      </div>
      <div v-if="param==4">
        <el-tabs v-model="activeName4" >
            <el-tab-pane label="审计整改材料提炼" name="1" v-if="menuIds.includes(17)">
              <auditCorrection v-if="activeName4==1"/>
            </el-tab-pane>
        </el-tabs>
      </div>
          
    </div>
</template>
<script>
import auditImplementation from './AuditImplementation'
import auditCorrection from './AuditCorrection'
import auditReport from './AuditReport'
import projectPreparation from './ProjectPreparation'
import RegulatorySearch from './component/RegulatorySearch.vue';
import PickupForm from './component/PickupForm.vue';
import MeetingMinutes from './component/MeetingMinutes.vue';
import SqlCreate from './component/SqlCreate.vue';
import AutoWorkpaper from './component/AutoWorkpaper.vue';
import SimilarityCheck from './component/SimilarityCheck.vue';
import ImportentPlan from './component/ImportentPlan.vue';
import ProblemAnalysis from './component/ProblemAnalysis.vue';
import PickupFormNew from './component/PickupFormNew.vue';



export default {
  name: 'Home',  
  components: { ProblemAnalysis,SqlCreate,RegulatorySearch,MeetingMinutes,AutoWorkpaper,SimilarityCheck,PickupForm,ImportentPlan,auditImplementation,auditCorrection,auditReport,projectPreparation,PickupFormNew },
  props: {
    param: {
      type: Number,
      required: true
    }
  },
  data(){
    return{
      menuIds:[],
      activeName:"1",
      activeName2:"1",
      activeName3:"1",
      activeName4:"1",
    }
  },
  computed: {
  },
  methods:{
    getMenu(){
      console.log(120,localStorage.getItem("projectId"));
      let projectId=localStorage.getItem("projectId");
      this.$axios.get('/api/services/hzsfjtai/menu/getTreeDataByProjectId?projectId='+projectId, {}).then(res => {
            if (res.data.code === 200) {
              this.menuIds=res.data.data.map(pro => pro.id)
              console.log(89,this.menuIds);
               
            } else {
              this.$message(res.data.msg)
            }
          }).catch(err => {
            this.$message.error(err)
          })
    },
  },
  mounted() {
    this.getMenu();
  }
}
</script>
<style scoped lang="less" >

</style>


